package com.norman.sorry.core.tiles;

import java.awt.Color;
import java.util.Collection;
import java.util.List;

import com.norman.sorry.core.pieces.IPiece;

/**
 * Represents a slide on the game board that game pieces can occupy. This
 * interface requires a few basic methods that are critical to the game.
 * 
 * @author Brian Norman
 * @version 0.0.1 beta
 * @since 0.0.1 beta
 */
public interface ISlide extends ITile {

   /**
    * Returns the color of the slide.
    * 
    * @return the color of the slide.
    */
   public Color getColor();

   /**
    * Returns the tiles the slide covers.
    * 
    * @return the tiles the slide covers.
    */
   public List<? extends ITile> getSlide();

   /**
    * Returns the first tile in the slide. Usually this is the slide itself.
    * 
    * @return the first tile in the slide.
    */
   public ITile getStart();

   /**
    * Returns the last tile in the slide.
    * 
    * @return the last tile in the slide.
    */
   public ITile getEnd();

   /**
    * Returns if the color is allowed to slide. This is used to determine if a
    * game piece is allowed to slide. For a game piece to slide its color must
    * be different than the color of the slide.
    * 
    * @param color
    *           the color of the game piece.
    * 
    * @return if the color is allowed to slide.
    */
   public boolean canSlide(Color color);

   /**
    * Returns and removes all the game pieces from the slide. This only removes
    * the tiles knowledge that it contains a game piece, it does not remove the
    * mapping of the game piece to the tile.
    * 
    * @return the game pieces that were removed.
    */
   public Collection<IPiece> removePieces();

}
